import request from './request'

// Get diagram graph by ID
export function getDiagramGraph(diagramId) {
  const id = diagramId != null ? diagramId : ''
  return request.get(`/diagrams/${id}/graph`)
}

// Save diagram graph by ID
export function saveDiagramGraph(diagramId, payload) {
  const id = diagramId != null ? diagramId : ''
  return request.post(`/diagrams/${id}/graph`, payload)
}

// List diagrams (pagination supported)
export function listDiagrams(params) {
  return request.get('/diagrams', { params })
}


